﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DCS.Business.Model
{
    /// <summary>
    /// LDMMessage
    /// </summary>
    public class LDMMessage : ICloneable
    {
        #region ctor.

        /// <summary>
        /// LDMMessage 构造函数
        /// </summary>
        public LDMMessage()
        { }

        /// <summary>
        /// LDMMessage OR映射构造函数
        /// </summary>
        public LDMMessage(System.Data.IDataReader dr)
        {
            this.MessageId = (Guid)dr["MessageId"];
            this.Carrier = Convert.ToString(dr["Carrier"]);
            this.FlightNo = Convert.ToString(dr["FlightNo"]);
            this.PDate = Convert.ToDateTime(dr["PDate"]);
            this.PTime = Convert.ToDateTime(dr["PTime"]);
            this.DeptAirport = Convert.ToString(dr["DeptAirport"]);
            this.ArrAirport = Convert.ToString(dr["ArrAirport"]);
            this.RegNo = Convert.ToString(dr["RegNo"]);
            this.PaxLayout = Convert.ToString(dr["PaxLayout"]);
            this.Crew = Convert.ToString(dr["Crew"]);
            this.Adult = Convert.ToInt32(dr["Adult"]);
            this.Child = Convert.ToInt32(dr["Child"]);
            this.Baby = Convert.ToInt32(dr["Baby"]);
            this.BagWeight = Convert.ToInt32(dr["BagWeight"]);
            this.LoadTotal = Convert.ToInt32(dr["LoadTotal"]);
            this.LoadInCompartment = Convert.ToString(dr["LoadInCompartment"]);
            this.PaxF = Convert.ToInt32(dr["PaxF"]);
            this.PaxC = Convert.ToInt32(dr["PaxC"]);
            this.PaxY = Convert.ToInt32(dr["PaxY"]);
            this.PadF = Convert.ToInt32(dr["PadF"]);
            this.PadC = Convert.ToInt32(dr["PadC"]);
            this.PadY = Convert.ToInt32(dr["PadY"]);
            this.AdditionalInfo = Convert.ToString(dr["AdditionalInfo"]);
            this.RefFileId = Convert.ToInt32(dr["RefFileId"]);

        }

        #endregion

        #region Properties

        /// <summary>
        /// 
        /// </summary>
        public Guid MessageId { get; set; }

        /// <summary>
        /// 承运人
        /// </summary>
        public string Carrier { get; set; }

        /// <summary>
        /// 航班号
        /// </summary>
        public string FlightNo { get; set; }

        /// <summary>
        /// 日期
        /// </summary>
        public DateTime PDate { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime PTime { get; set; }

        /// <summary>
        /// 起飞站
        /// </summary>
        public string DeptAirport { get; set; }

        /// <summary>
        /// 到达站
        /// </summary>
        public string ArrAirport { get; set; }

        /// <summary>
        /// 飞机注册号
        /// </summary>
        public string RegNo { get; set; }

        /// <summary>
        /// 座舱布局
        /// </summary>
        public string PaxLayout { get; set; }

        /// <summary>
        /// 工作人员： 驾驶舱/客舱
        /// </summary>
        public string Crew { get; set; }

        /// <summary>
        /// 成人数
        /// </summary>
        public int Adult { get; set; }

        /// <summary>
        /// 儿童数
        /// </summary>
        public int Child { get; set; }

        /// <summary>
        /// 婴儿数
        /// </summary>
        public int Baby { get; set; }

        /// <summary>
        /// 随身行李重量
        /// </summary>
        public int BagWeight { get; set; }

        /// <summary>
        /// 恒载重量
        /// </summary>
        public int LoadTotal { get; set; }

        /// <summary>
        /// 货舱中业载重量/每货舱分开
        /// </summary>
        public string LoadInCompartment { get; set; }

        /// <summary>
        /// 头等舱人数
        /// </summary>
        public int PaxF { get; set; }

        /// <summary>
        /// 公务舱人数
        /// </summary>
        public int PaxC { get; set; }

        /// <summary>
        /// 经济舱人数
        /// </summary>
        public int PaxY { get; set; }

        /// <summary>
        /// 头等舱PAD人数
        /// </summary>
        public int PadF { get; set; }

        /// <summary>
        /// 公务舱PAD人数
        /// </summary>
        public int PadC { get; set; }

        /// <summary>
        /// 经济舱PAD人数
        /// </summary>
        public int PadY { get; set; }

        /// <summary>
        /// 补充信息，包括系统自动生成部分和LMSD指令中手工输入部分
        /// </summary>
        public string AdditionalInfo { get; set; }

        /// <summary>
        /// 舱单内容
        /// </summary>
        public string LspContent { get; set; }

        /// <summary>
        /// 所对应的DCS文件Id
        /// </summary>
        public int RefFileId { get; set; }

        #endregion

        #region ICloneable Members

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }
}
